package com.lekang.system.service.impl;

import java.util.List;
import com.lekang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lekang.system.mapper.VisitorRegistrationMapper;
import com.lekang.system.domain.VisitorRegistration;
import com.lekang.system.service.IVisitorRegistrationService;

/**
 * 来访登记Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-13
 */
@Service
public class VisitorRegistrationServiceImpl implements IVisitorRegistrationService 
{
    @Autowired
    private VisitorRegistrationMapper visitorRegistrationMapper;

    /**
     * 查询来访登记
     * 
     * @param id 来访登记主键
     * @return 来访登记
     */
    @Override
    public VisitorRegistration selectVisitorRegistrationById(Long id)
    {
        return visitorRegistrationMapper.selectVisitorRegistrationById(id);
    }

    /**
     * 查询来访登记列表
     * 
     * @param visitorRegistration 来访登记
     * @return 来访登记
     */
    @Override
    public List<VisitorRegistration> selectVisitorRegistrationList(VisitorRegistration visitorRegistration)
    {
        return visitorRegistrationMapper.selectVisitorRegistrationList(visitorRegistration);
    }

    /**
     * 新增来访登记
     * 
     * @param visitorRegistration 来访登记
     * @return 结果
     */
    @Override
    public int insertVisitorRegistration(VisitorRegistration visitorRegistration)
    {
        visitorRegistration.setCreateTime(DateUtils.getNowDate());
        return visitorRegistrationMapper.insertVisitorRegistration(visitorRegistration);
    }

    /**
     * 修改来访登记
     * 
     * @param visitorRegistration 来访登记
     * @return 结果
     */
    @Override
    public int updateVisitorRegistration(VisitorRegistration visitorRegistration)
    {
        return visitorRegistrationMapper.updateVisitorRegistration(visitorRegistration);
    }

    /**
     * 批量删除来访登记
     * 
     * @param ids 需要删除的来访登记主键
     * @return 结果
     */
    @Override
    public int deleteVisitorRegistrationByIds(Long[] ids)
    {
        return visitorRegistrationMapper.deleteVisitorRegistrationByIds(ids);
    }

    /**
     * 删除来访登记信息
     * 
     * @param id 来访登记主键
     * @return 结果
     */
    @Override
    public int deleteVisitorRegistrationById(Long id)
    {
        return visitorRegistrationMapper.deleteVisitorRegistrationById(id);
    }

    @Override
    public List<VisitorRegistration> selectVisitorRegistrationByVisitType(VisitorRegistration visitorRegistration) {
        List<VisitorRegistration> visitorRegistrations = visitorRegistrationMapper.selectVisitorRegistrationByVisitType(visitorRegistration);
        return visitorRegistrations;
    }
}
